package br.ufc.great;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapController;

import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;

public class LocationListenerMap implements LocationListener {

	MapController mapController;
	
	public LocationListenerMap(MapController mapController)
	{
		this.mapController = mapController;
	}
	@Override
	public void onLocationChanged(Location location) {
		
		int lat = (int) ((float)location.getLatitude() * 1E6);
        int lng = (int) ((float)location.getLongitude() * 1E6);
        GeoPoint g = new GeoPoint(lat, lng);
        
		mapController.animateTo(g);
		
	}

	@Override
	public void onProviderDisabled(String arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onProviderEnabled(String arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onStatusChanged(String arg0, int arg1, Bundle arg2) {
		// TODO Auto-generated method stub
		
	}

}
